/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Modelo;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ChArFaTo
 */
@Entity
@Table(name = "jefe_de_programa", catalog = "proyectosw", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "JefeDeProgramaEJB.findAll", query = "SELECT j FROM JefeDeProgramaEJB j"),
    @NamedQuery(name = "JefeDeProgramaEJB.findByJCodigo", query = "SELECT j FROM JefeDeProgramaEJB j WHERE j.jCodigo = :jCodigo"),
    @NamedQuery(name = "JefeDeProgramaEJB.findByJPrograma", query = "SELECT j FROM JefeDeProgramaEJB j WHERE j.jPrograma = :jPrograma")})
public class JefeDeProgramaEJB implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer jCodigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(nullable = false, length = 50)
    private String jPrograma;
    @OneToMany(mappedBy = "jefedeProgramaJCodigo")
    private Collection<SalarioEJB> salarioEJBCollection;
    @JoinColumn(name = "PersonaPIdentificacion", referencedColumnName = "PIdentificacion")
    @ManyToOne
    private PersonaEJB personaPIdentificacion;
    @OneToMany(mappedBy = "jefedeProgramaJCodigo")
    private Collection<MatriculaacademicaEJB> matriculaacademicaEJBCollection;

    public JefeDeProgramaEJB() {
    }

    public JefeDeProgramaEJB(Integer jCodigo) {
        this.jCodigo = jCodigo;
    }

    public JefeDeProgramaEJB(Integer jCodigo, String jPrograma) {
        this.jCodigo = jCodigo;
        this.jPrograma = jPrograma;
    }

    public Integer getJCodigo() {
        return jCodigo;
    }

    public void setJCodigo(Integer jCodigo) {
        this.jCodigo = jCodigo;
    }

    public String getJPrograma() {
        return jPrograma;
    }

    public void setJPrograma(String jPrograma) {
        this.jPrograma = jPrograma;
    }

    @XmlTransient
    public Collection<SalarioEJB> getSalarioEJBCollection() {
        return salarioEJBCollection;
    }

    public void setSalarioEJBCollection(Collection<SalarioEJB> salarioEJBCollection) {
        this.salarioEJBCollection = salarioEJBCollection;
    }

    public PersonaEJB getPersonaPIdentificacion() {
        return personaPIdentificacion;
    }

    public void setPersonaPIdentificacion(PersonaEJB personaPIdentificacion) {
        this.personaPIdentificacion = personaPIdentificacion;
    }

    @XmlTransient
    public Collection<MatriculaacademicaEJB> getMatriculaacademicaEJBCollection() {
        return matriculaacademicaEJBCollection;
    }

    public void setMatriculaacademicaEJBCollection(Collection<MatriculaacademicaEJB> matriculaacademicaEJBCollection) {
        this.matriculaacademicaEJBCollection = matriculaacademicaEJBCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (jCodigo != null ? jCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof JefeDeProgramaEJB)) {
            return false;
        }
        JefeDeProgramaEJB other = (JefeDeProgramaEJB) object;
        if ((this.jCodigo == null && other.jCodigo != null) || (this.jCodigo != null && !this.jCodigo.equals(other.jCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Modelo.JefeDeProgramaEJB[ jCodigo=" + jCodigo + " ]";
    }
    
}
